<template>
  <div class="comment-container">
    <div class="like"
      @click="isLike">
      <i v-if="isShowLike"
        class="iconfont icon-xihuan"></i>
      <i v-else
        class="iconfont icon-xihuan1"></i>

    </div>
    <div class="load">
      <i class="iconfont icon-xiazai"></i>
    </div>
    <div class="comment"
      @click="isShowCom">
      <van-icon name="chat-o" />
    </div>
    <div class="list">
      <i class="iconfont icon-Androidgengduo"></i>
    </div>

    <!-- 用户评论 -->
    <van-popup v-model="isShow"
      position="bottom"
      :style="{ height: '100%' }">
        <CommentItem :currentMusic="currentMusic" @close="isShow=false"></CommentItem>
    </van-popup>
  </div>
</template>

<script>
import { mapState } from 'vuex'
import CommentItem from './CommentItem.vue'
export default {
  data () {
    return {
      isShowLike: false,
      isShow: false, // 是否展示品论
      commentList: []
    }
  },
  computed: {
    ...mapState(['currentMusic'])
  },
  async created () {
    console.log(this.currentMusic)
  },
  methods: {
    isLike () {
      console.log('点击了')
      this.isShowLike = !this.isShowLike
    },
    async isShowCom () {
      this.isShow = true

      // 获取音频
      // id=1920680156&limit=1
    }
  },
  components: {
    CommentItem
  }
}
</script>

<style lang="less" scoped>
.comment-container{
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0 20px;
  color: #fff;

  .iconfont{
    font-size: 23px;
  }
  .like{
    .icon-xihuan{
      color: red;
    }
  }
}

</style>
